<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="/css/common.css"/>
    <script type="text/javascript">
        function refresh() {
            document.getElementById('captcha_img').src="/permission/kaptcha/render";
        }

        function toRegister() {
            var uri = document.getElementById("register").value;
            window.location.href=uri;
        }

    </script>
</head>
<body>

<div align="center">


    <form th:action="@{/permission/login}" method="post">
        <div>
            <span id="basic-addon0">&nbsp;</span>
            <span style="font-size: 18px;color: red" th:text="${error}"></span>
            <br/>
        </div>
        <div>
            <span style="font-size: 18px;color: red" th:text="${msg}"></span>
            <br/>
        </div>
        <div>
            <span id="basic-addon1">用户名:</span>
            <input id="name" name="name" type="text" placeholder="用户名"/>

        </div>
        <br/>
        <div>
            <span id="basic-addon2">密码:</span>
            <input id="password" name="password" type="password" placeholder="密码"/>
        </div>
        <br/>
        <img id="captcha_img" src="/permission/kaptcha/render" alt="点击更换" title="点击更换" onclick="refresh()">
        <input id="kaptchaCode" name="kaptchaCode" type="text">
        <br/>
        <button type="submit" style="width:190px;">登 录</button>
        <br/>
        <button id="register" type="button" value="/permission/user/register" onclick="toRegister()" style="width:190px;">注 册</button>
    </form>

</div>
</body>
</html>